package com.wn.order.mapper;


import com.wn.common.pojo.Orders;
import com.wn.common.pojo.Percentage;
import com.wn.order.vo.CarPortAreaVillageVo;
import com.wn.order.vo.MyOrderVo;
import com.wn.order.vo.PropertyLessorVo;
import com.wn.order.vo.ViewEarnings;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;


import java.math.BigDecimal;
import java.util.List;

/**
 * @BelongsProject: shared_parking
 * @BelongsPackage: com.wn.order.mapper
 * @Author: 段彪
 * @CreateTime: 2020-06-11 12:12
 * @Description: dao层接口
 */
public interface OrderMapper {

    //查询所有订单详情(平台方)
    List<Orders> getAll();

    //根据字段获取某个对象
    Orders getOrdersByName(@Param("username") String username);
    //查询我的订单
    List<MyOrderVo> getMyOrder(MyOrderVo myOrderVo);

    //通过对象的参数判断是否存在这样的对象
    Orders existOneByCondition();

    //生成评论
    Integer addComment(@Param("coId") String coId,@Param("oId") String oId,@Param("username") String username);

    //添加订单所有信息
    Integer addOrders(Orders orders);



    //查询订单需要角色id
    Orders getAllId(@Param("packing") String packing);

    //在车位里面添加订单信息
    Integer updateByOrderId(@Param("oId") String oId,@Param("parkingId") String parkingId);

    //查看支付状态
    Orders getPayCode(@Param("oId") String oId);

    //修改订单状态
    Integer updateOrderStatus(@Param("oId") String oId);

    //逻辑删除订单
    Integer deleteOrdersById(@Param("oId") String oId);

    //通过id物理删除一个对象
    Integer deleteOneTrueById();

    //恢复一个被逻辑删除的对象
    Integer recoverOrdersById(String oId);

    //Tenant Property Lessor查询订单详情
    List<PropertyLessorVo> getTPLAll();

    //根据订单username模糊查询
    List<ViewEarnings> fuzzQueryById(String username);

    //分页查询
    List<Orders> pagingQuery();

    //查询username
    List<PropertyLessorVo> queryName();

    //查询出租方物业name
    List<PropertyLessorVo> queryRenterProperty();

    ///平台方订单查询
    List<PropertyLessorVo> queryPropertyLessorVo();

    //平台方订单查询
    List<PropertyLessorVo> getProperty(String username);

    //出租方订单查询
    List<PropertyLessorVo> getLessonOrder(@Param("uId") String uId,String username);

    //物业方订单查询
    List<PropertyLessorVo> getPropertyOrder(@Param("uId") String uId,String username);

    //普通结算
    BigDecimal SettlementMoney(@Param("hour") Integer hour);

      //超时订单结算
//    BigDecimal timeOutSettlement(@Param("hours")Integer hour);

    //平台提成查询
    List<ViewEarnings> getPlatformCommission(@Param("realName") String realName);

    //物业方提成查询
    List<ViewEarnings> getPropertyCommission();

    //出租方提成
    List<ViewEarnings> getLessorCommission();

    //查询提成
    List<Percentage> getAllPercentage();

    //根据oid来条件修改一个对象
    Integer updatePercentage(@Param("tcId") String tcId,@Param("commission") BigDecimal commission);

    //车位信息
    CarPortAreaVillageVo getCarportVo(@Param("cpId") String cpId);

    //物业方收益提成
    List<ViewEarnings> PropertyCommission(@Param("uId") String uId,String username);

    //出租方收益提成
    List<ViewEarnings> LessorCommission(@Param("uId") String uId,String username);
}
